#ifndef _WX_RADIOBOX_H_BASE_
#define _WX_RADIOBOX_H_BASE_

#if wxUSE_RADIOBOX

#include "wx/ctrlsub.h"

#if wxUSE_TOOLTIPS

#include "wx/dynarray.h"

class wxToolTip;

WX_DEFINE_EXPORTED_ARRAY_PTR( wxToolTip *, wxToolTipArray );

#endif // wxUSE_TOOLTIPS

extern const wxChar wxRadioBoxNameStr[];

class wxRadioBoxBase : public wxItemContainerImmutable {
  public:
    virtual ~wxRadioBoxBase();

    // change/query the individual radio button state
    virtual bool Enable( unsigned int n, bool enable = true ) = 0;
    virtual bool Show( unsigned int n, bool show = true ) = 0;
    virtual bool IsItemEnabled( unsigned int n ) const = 0;
    virtual bool IsItemShown( unsigned int n ) const = 0;

    // return number of columns/rows in this radiobox
    unsigned int GetColumnCount() const { return m_numCols; }
    unsigned int GetRowCount() const { return m_numRows; }

    // return the next active (i.e. shown and not disabled) item above/below/to
    // the left/right of the given one
    int GetNextItem( int item, wxDirection dir, long style ) const;

    #if wxUSE_TOOLTIPS
    // set the tooltip text for a radio item, empty string unsets any tooltip
    void SetItemToolTip( unsigned int item, const wxString& text );

    // get the individual items tooltip; returns NULL if none
    wxToolTip *GetItemToolTip( unsigned int item ) const
    { return m_itemsTooltips ? ( *m_itemsTooltips )[item] : NULL; }
    #endif // wxUSE_TOOLTIPS

    void SetItemHelpText( unsigned int n, const wxString& helpText );

    // retrieve helptext for a particular item, empty string means no help text
    wxString GetItemHelpText( unsigned int n ) const;
    virtual int GetItemFromPoint( const wxPoint& ( pt ) ) const {
      return wxNOT_FOUND;
    }
  protected:
    wxRadioBoxBase() {
      m_numCols =
        m_numRows =
          m_majorDim = 0;
      #if wxUSE_TOOLTIPS
      m_itemsTooltips = NULL;
      #endif // wxUSE_TOOLTIPS
    }
    unsigned int GetMajorDim() const { return m_majorDim; }
    void SetMajorDim( unsigned int majorDim, long style );

    #if wxUSE_TOOLTIPS
    virtual void DoSetItemToolTip( unsigned int item, wxToolTip *tooltip );

    // returns true if we have any item tooltips
    bool HasItemToolTips() const { return m_itemsTooltips != NULL; }
    #endif // wxUSE_TOOLTIPS

    wxString DoGetHelpTextAtPoint( const wxWindow *derived,const wxPoint& pt,wxHelpEvent::Origin origin ) const;
  private:
    unsigned int m_majorDim,
             m_numCols,
             m_numRows;

    #if wxUSE_TOOLTIPS
    // array of tooltips for the individual items
    //
    // this array is initially NULL and initialized on first use
    wxToolTipArray *m_itemsTooltips;
    #endif

    wxArrayString m_itemsHelpTexts;
};

#include "wx/gtk/radiobox.h"

#endif // wxUSE_RADIOBOX

#endif // _WX_RADIOBOX_H_BASE_
